<?
$str = <<< END
<emails>
   <email type="mime">
      <from>nowhere@notadomain.tld</from>
      <to>unknown@unknown.tld</to>
      <subject>brak tematu</subject>
      <body><![CDATA[Czy to jest tre wiadomoci? O, tak plus dodatkowy tekst &
         symbole.]]></body>
  </email>
</emails>
END;
$sxml = simplexml_load_string($str);
foreach ($sxml->email as $email)
echo $email['type'];
?>
